import request from "./request";
import { message } from "antd";

//注册
export const registerFetch = async (payload: {username: string, password: string}) => {
    return request.post({
        url: '/api/user',
        data: payload
    })
}

//登录
export const loginFetch = async (payload: {username: string, password: string}) => {
    return request.post({
        url: '/api/user/login',
        data: payload
    })
}

// 获取用户信息
export const getUserInfoFetch = async () => {
    return request.get({
        url: '/api/user/getUserInfo'
    })
}
